package com.base.system.jpa.repository;

import com.base.system.jpa.entity.JpaUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Optional;

public interface UserRepository extends JpaRepository<JpaUser, Long>, JpaSpecificationExecutor<JpaUser> {
    Optional<JpaUser> findFirstByUserAcountOrPhoneOrEmailOrIdNumber(String acount, String phone, String email, String idNumber);

    Optional<JpaUser> findFirstByUserAcount(String acount);

    Optional<JpaUser> findFirstByEmail(String email);

    Optional<JpaUser> findFirstByPhone(String phone);

    Optional<JpaUser> findFirstByIdNumber(String idNumber);
}
